using System;


public class Program
{
    public static void Main(string[] args)
    {
        int []num=new int[100];
        for (int i = 0; i < num.Length; i++)
        {
            Random random = new Random();
            num[i]= random.Next(1000);
        }

        var digit=
            from n in num
            orderby n
            select n;
        int sum=
            digit.Sum();
        double averg =
            digit.Average();
            
        foreach (int i in digit)
        {
            Console.WriteLine(i);
        }
        Console.WriteLine(sum);
        Console.WriteLine(averg);
    }
}
    


